package cn.bugstack.domain.activity.service.trial.thread;

import cn.bugstack.domain.activity.adapter.repository.IActivityRepository;
import cn.bugstack.domain.activity.model.valobj.GroupBuyActivityDiscountVO;
import java.util.Calendar;
import java.util.concurrent.Callable;

import cn.bugstack.domain.activity.model.valobj.SCSkuActivityVO;
import lombok.Data;

/**
 * @author hsj
 * @date 2025/2/14 10:35
 */
@Data
public class QueryGroupBuyActivityDiscountVOThreadTask implements Callable<GroupBuyActivityDiscountVO> {

	private final String source;

	private final String channel;

	/**
	 * 商品ID
	 */
	private final String goodsId;

	private final IActivityRepository activityRepository;

	@Override
	public GroupBuyActivityDiscountVO call() throws Exception {
		// 查询渠道商品活动配置关联配置
		SCSkuActivityVO scSkuActivityVO = activityRepository.querySCSkuActivityBySCGoodsId(source, channel, goodsId);
		if (null == scSkuActivityVO) return null;
		// 查询活动配置
		return activityRepository.queryGroupBuyActivityDiscountVO(scSkuActivityVO.getActivityId());
	}

}
